<%@Page Language="VB"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>Using CSS to Add Style to ASP Controls</title>
<style type="text/css">
body {font-family:Tahoma,Arial,sans-serif; font-size:10pt}
input {font-family:Tahoma,Arial,sans-serif; font-size:9pt}
.heading {font-family:Tahoma,Arial,sans-serif; font-size:14pt; font-weight:bold}
.subhead {font-family:Tahoma,Arial,sans-serif; font-size:12pt; font-weight:bold; padding-bottom:5px}
.cite {font-family:Tahoma,Arial,sans-serif; font-size:8pt}
</style></head>
<body bgcolor="#ffffff">
<span class="heading">Using CSS to Add Style to ASP Controls</span><hr />
<!--------------------------------------------------------------------------->

<ASP:Label id="MyASPLabel" runat="server"
  Text="<%# MyValue %>"
  BackColor = "yellow"
  ForeColor = "blue"
  ToolTip = "A yellow and blue label"
  BorderStyle = "None"
  Font-Name = "Tahoma"
  Font-Size = "16pt"
  Font-Bold = "True"
  Font-Underline = "True"
/>
<p />
<ASP:TextBox id="MyASPText" runat="server"
  Text="<%# MyValue %>"
  BackColor = "red"
  ForeColor = "black"
  ToolTip = "A read and black text box"
  BorderColor = "black"
  BorderWidth = "1"
  Font-Name = "Comic Sans MS"
  Font-Size = "12pt"
  Font-Bold = "True"
/>
<p />
<ASP:Button id="MyASPButton" runat="server"
  Text="<%# MyValue %>"
  BackColor = "green"
  ForeColor = "white"
  ToolTip = "A green and white button"
  BorderStyle = "Outset"
  Font-Name = "Arial Black"
  Font-Size = "12pt"
  Font-Bold = "False"
/>

<!--------------------------------------------------------------------------->

<script language="vb" runat="server">

ReadOnly Property MyValue() As String
   'declare a read-only property for the Page
   Get
       Return "My Property Value"
   End Get
End Property

Sub Page_Load()
   'bind all the controls on the page
   Page.DataBind()
End Sub

</script>

<!--------------------------------------------------------------------------->
<hr /><span class="cite">[<a href="../global/viewsource.aspx">view source</a>] &nbsp; &nbsp; &nbsp; &nbsp;
&copy;2001 <a class="cite" href="http://www.wrox.com/">Wrox Press</a> -
<a class="cite" href="http://www.wrox.com/Books/Book_Details.asp?isbn=1861004885">Professional ASP.NET</a> (ISBN: 1-861004-88-5)</span>
</body>
</html>
